<!DOCTYPE html>
<html lang="en">

<head>
<title>简学-后台登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="Thu, 19 Nov 1900 08:52:00 GMT">
<!--Loading bootstrap css-->
<link type="text/css" rel="stylesheet"
	href="static/vendors/font-awesome/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet"
	href="static/vendors/bootstrap/css/bootstrap.min.css">
<!--Loading style vendors-->
<link type="text/css" rel="stylesheet"
	href="static/vendors/animate.css/animate.css">
<link type="text/css" rel="stylesheet"
	href="static/vendors/iCheck/skins/all.css">
<!--Loading style-->
<link type="text/css" rel="stylesheet"
	href="static/css/themes/style1/pink-blue.css" class="default-style">
<link type="text/css" rel="stylesheet"
	href="static/css/themes/style1/pink-blue.css" id="theme-change"
	class="style-change color-change">
<link type="text/css" rel="stylesheet"
	href="static/css/style-responsive.css">
<link rel="shortcut icon" href="static/images/favicon.ico">

</head>
<style type="text/css">
body {
    padding: 0px;
    margin: 0px;
   
    color:#666;
    font: 12px/1.5 Arial, 'Droid Sans', 'Hiragino Sans GB','Microsoft YaHei';
}

a {
    color:#777;
}

a:hover, a:focus {
    color:#fff;
}
#phoneLog:hover,#webLog:hover{
	cursor: pointer;
	}
.top-radius{
    border-top-left-radius: 2px;
    border-top-right-radius:2px;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius:0px;
}

.bottom-radius{
    border-top-left-radius: 0px;
    border-top-right-radius:0px;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius:2px;
}


.all-radius{
    border-top-left-radius: 2px;
    border-top-right-radius:2px;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius:2px;
}


.login-input {
    background-color: #fff; 
    padding: 11px 10px 11px 13px;
    display: block;
    background-color: rgba(255,255,255,0.95);
    border: 1px solid #fff;
    margin: 0;
    border: 0;
    font-family: Helvetica, STHeiti;
    font-size: 12px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    width: 300px;
}

.login-input:focus{
  
}


.breath {
    filter: alpha(opacity=50);
    -moz-opacity: 0.5;
    opacity: 0.5;
    -webkit-animation-name: breath;
    -webkit-animation-duration: 8s;
    -webkit-animation-timing-function: ease-in-out;
    -webkit-animation-iteration-count: infinite;
}

@-webkit-keyframes 'breath' {
    from {
        filter: alpha(opacity=1);
        -moz-opacity: 0.01;
        opacity: 0.01;
    }
    30% {
        filter: alpha(opacity=50);
        -moz-opacity: 0.5;
        opacity: 0.5;
    }
    70% {
        filter: alpha(opacity=50);
        -moz-opacity: 0.5;
        opacity: 0.5;
    }
    to {
        filter: alpha(opacity=1);
        -moz-opacity: 0.01;
        opacity: 0.01;
    }
}


@-moz-keyframes fullexpand {
    0% {
        width: 0px;
    }
    15% {
        width: 90%;
    }
    100% {
        width: 100%;
    }
}

@-webkit-keyframes fullexpand {
    0% {
        width: 0px;
    }
    15% {
        width: 90%;
    }
    100% {
        width: 100%;
    }
}


.trans {
    -webkit-transition: color 0.3s ease;
    -moz-transition: color 0.3s ease;
    -ms-transition: color 0.3s ease;
    -o-transition: color 0.3s ease;
    transition: color 0.3s ease;
}

*, *:active, *:focus {
    outline: 0;
    outline-style: none;
    outline-width: 0;
    -moz-outline-width: 0;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    text-decoration: none;
}

.login-in-btn {
    font-size: 13px;
    font-weight: 500;
    line-height: 38px;
    background-color: rgb(70,175,95);
    background-color: rgba(70,175,95,0.9);
    color: #fff;
    border-radius: 2px;
    width:300px;
    height: 38px;
    overflow: hidden;
    white-space: nowrap;
    -webkit-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    -moz-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    cursor: pointer;
}
.login-in-btn:focus, .login-in-btn:hover {
  background-color: rgb(90,225,125);
    background-color: rgba(90,225,125,0.9);
}

.sign-up-btn {
    font-size: 13px;
    font-weight: 500;
    line-height: 38px;
    background-color: rgb(41,119,186);
    background-color: rgba(41,119,186,0.9);
    color: #fff;
    border-radius: 2px;
    width:300px;
    height: 38px;
    overflow: hidden;
    white-space: nowrap;
    -webkit-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    -moz-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    cursor: pointer;
}

.sign-up-btn:focus, .sign-up-btn:hover {
  background-color: rgb(61,139,226);
    background-color: rgba(61,139,226,0.9);
}

.login-reply {
  color:#ec3627;
}

.sign-up-btn-small {
    font-family: Helvetica, STHeiti;
    font-size: 13px;
    text-align: center;
    line-height: 35px;
    background-color: rgba(41,119,186,0.8);
    color: #fff;
    border-radius: 2px;
    margin-right: 15px;
    margin-top: 7px;
    width:60px;
    height: 35px;
    overflow: hidden;
    white-space: nowrap;
    -webkit-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    -moz-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    float: left;
}


.sign-in-btn-small {
    font-family: Helvetica, STHeiti;
    font-size: 13px;
    text-align: center;
    line-height: 35px;
    background-color: rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 2px;
    margin-right: 15px;
    margin-top: 7px;
    width:60px;
    height: 35px;
    overflow: hidden;
    white-space: nowrap;
    -webkit-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    -moz-transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    transition: all .25s cubic-bezier(.165,.84,.44,1),opacity 1ms linear;
    float: left;
    
}


.footer {
    color:#777;
}

#nav-bar {
    width: 100%;
    background-color: rgba(10,10,10,0.15);
    height: 50px;
    position: absolute;
    top:0px;
}

.nav-head {
    width:100%;margin-left: auto;margin-right: auto;
    height: 50px;
}
.selectLog:after{
		clear:both;
		content:"\200B";
		display:block;
		height:0;
}
.selectLog{
	background-color: rgba(50,50,50,0.6);
	border-bottom:1px solid rgba(50,50,50,1);
}
.selectLog >div:hover{
	cursor: pointer;
	color: white;
}
</style>

<style>
	#phoneLog{float: left; border-bottom: 1px solid #fff;font-size: 25px;padding: 10px 0 10px 0;width: 190px;}
	#webLog{float: right;border-bottom: 1px solid rgba(50,50,50,0);font-size: 15px;padding: 10px 0 10px 0;width: 189px;}
	.selectLog .v-line{float: left;width: 1px;height: 43px;background-color: #323232;}

	.other-wrap{overflow: hidden;margin-top: 20px;}
	.other-wrap .social-signup{float: left;}
	.other-wrap .social-signup span {
		vertical-align: middle;
	}
	.other-wrap .social-signup a {
		display: inline-block;
		color: #ccc;
		margin-left: 10px;
	}
	.other-wrap .social-signup i {
		vertical-align: middle;
		font-size: 16px;
		cursor: pointer;
		-webkit-transition: all 300ms ease-in-out;
		-moz-transition: all 300ms ease-in-out;
		transition: all 300ms ease-in-out;
	}
	.other-wrap .social-signup i:hover {
		color: #fff;
	}
	.other-wrap .forget-pwd{float: right;}
	.other-wrap .forget-pwd a {
		margin-left: 3px;
		margin-top: 20px;
		color: #ccc;
		font-size: 12px;
		-webkit-transition: all 300ms ease-in-out;
		-moz-transition: all 300ms ease-in-out;
		transition: all 300ms ease-in-out;
	}
	.other-wrap .forget-pwd a:hover {
		color: #fff;
	}

</style>

<body id="signin-page">
<div style="position: absolute;top:13%;left :50%;margin: 0 0 0 -190px;">
<div style="margin-left: auto;margin-right: auto;width: 400px;text-align: center;">
           <h1 style="color:#000;">简学-管理后台</h1>
	<div class="page-form">
		<form action="#" class="form" method="post">
			<div class="header-content">
				<h1>用户登录</h1>
				<input id="sessionKap" name="sessionKap" type="hidden" value="${sessionKap}">
			</div>
			<div class="body-content">
				<!--  -->
				<p></p>

				<div class="form-group">
					<p style="float: left;font-size: 14px">用户名：</p>
					<div class="input-icon right">
						 <input type="text" placeholder="请输入"
							name="username" id="username" class="form-control" value="">
					</div>
				</div>
				<div class="form-group">
				<p style="float: left;font-size: 14px">密码：</p>
					<div class="input-icon right">
						 <input type="password" placeholder="请输入"
							name="password" id="password" class="form-control" value="">
					</div>
				</div>
				<div style="display: none;" id="kaptchaShow">
					<input name="kaptcha" type="text" id="kaptcha" class="form-control" style="width: 100px; float: left;"/>
   					<img src="kaptcha.jpg" id="kaptchaImage" />       
  					<a href="#" onclick="changeCode()">看不清?换一张</a>  
				</div>
				
				<div class="form-group pull-left" style="margin-top: 10px;display: none;" >
					<div class="checkbox-list">
						<label> <input type="checkbox" checked="checked"  id='checkbox' >&nbsp;
							记住账号密码</label>
					</div>
				</div>
				<div class="form-group pull-right" style="margin-top: 10px;">
					<button type="button" class="btn btn-success" onclick="login()">
						登录 &nbsp; <i class="fa fa-chevron-circle-right"></i>
					</button>
				</div>
				<div class="clearfix"></div>
				
				<hr>
				<p>
					${sysInfo}
				</p>
			</div>
		</form>
	</div>
	</div>
	</div>
	<script src="static/js/jquery-1.10.2.min.js"></script>
	<script src="static/js/jquery-migrate-1.2.1.min.js"></script>
	<script src="static/js/jquery-ui.js"></script>
	<!--loading bootstrap js-->
	<script src="static/vendors/bootstrap/js/bootstrap.min.js"></script>
	<script src="static/vendors/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js"></script>
	<script src="static/js/html5shiv.js"></script>
	<script src="static/js/respond.min.js"></script>
	<script src="static/vendors/iCheck/icheck.min.js"></script>
	<script src="static/vendors/iCheck/custom.min.js"></script>
	<script src="static/js/login.js"></script>
	<script>

		$(window).keydown(function(event) {  //键盘敲击事件
			if (event.keyCode == 13) {
				login();
			}
		});
	$(function(){
		var sessionKap= $("#sessionKap").val();
		if(sessionKap >2){
			 $("#kaptchaShow").show();
		}
		$("#kaptcha").val("");
		changeCode();
	});
	
	function login() {
		var userName = document.getElementById("username").value;  
		    if(userName == ''){  
		        alert("请输入用户名。");  
		        return;  
		    }  
	    var userPass = document.getElementById("password").value;  
		    if(userPass == ''){  
		        alert("请输入密码。");  
		        return;  
		    }  
	    var objChk = document.getElementById("checkbox");  
		    if(objChk.checked){  
		        //添加cookie  
		        addCookie("userName",userName,7,"/");  
		        addCookie("userPass",userPass,7,"/");  
		    }else{  
		        deleteCookie("userName","/");
		        deleteCookie("userPass","/");
		      
		    }  
			$.ajax({
				type : "post",
				url : "./userlogin.do",
				data : {
					"username" : userName,
					"password" : userPass,
					"kaptcha"  : $("#kaptcha").val()  
				},
				dataType : "json",
				async : false,
				success : function(data) {
				//alert(JSON.stringify(data));
					if ("ok"==data[0].tishi) {
						window.location.href = "main.html";
					} else if ("no"==data[0].tishi) {
						alert("请检查账号、密码是否正确！");
						if(data[0].kaptchaTime >2){
							 $("#kaptchaShow").show();
						}
						$("#kaptcha").val("");
						changeCode();
					}else if ("kaptcha"==data[0].tishi) {
						alert("验证码有误！请重新输入！");
						if(data[0].kaptchaTime >2){
							 $("#kaptchaShow").show();
						}
						$("#kaptcha").val("");
						changeCode();
					}else if("pastTime"==data[0].tishi){
						alert("试用期已过！");
					}
				}
			});
		}
	</script>
	<script type="text/javascript">
particlesJS('signin-page',
  {
    "particles": {
      "number": {
        "value": 110,
        "density": {
          "enable": true,
          "value_area": 800
        }
      },
      "color": {
        "value": "#ffffff"
      },
      "shape": {
        "type": "circle",
        "stroke": {
          "width": 0,
          "color": "#000000"
        },
        "polygon": {
          "nb_sides": 5
        },
        "image": {
          "src": "img/github.svg",
          "width": 100,
          "height": 100
        }
      },
      "opacity": {
        "value": 0.5,
        "random": false,
        "anim": {
          "enable": false,
          "speed": 1,
          "opacity_min": 0.1,
          "sync": false
        }
      },
      "size": {
        "value": 1,
        "random": true,
        "anim": {
          "enable": false,
          "speed": 20,
          "size_min": 0.1,
          "sync": false
        }
      },
      "line_linked": {
        "enable": true,
        "distance": 40,
        "color": "#fff",
        "opacity": 1,
        "width": 1
      },
      "move": {
        "enable": true,
        "speed": 3,
        "direction": "none",
        "random": false,
        "straight": false,
        "out_mode": "out",
        "attract": {
          "enable": false,
          "rotateX": 600,
          "rotateY": 1200
        }
      }
    },
    "interactivity": {
      "detect_on": "canvas",
      "events": {
        "onhover": {
          "enable": true,
          "mode": "grab"
        },
        "onclick": {
          "enable": true,
          "mode": "push"
        },
        "resize": true
      },
      "modes": {
        "grab": {
          "distance": 120,
          "line_linked": {
            "opacity": 1
          }
        },
        "bubble": {
          "distance": 400,
          "size": 40,
          "duration": 2,
          "opacity": 8,
          "speed": 3
        },
        "repulse": {
          "distance": 300
        },
        "push": {
          "particles_nb": 4
        },
        "remove": {
          "particles_nb": 2
        }
      }
    },
    "retina_detect": true,
    "config_demo": {
      "hide_card": false,
      "background_color": "#b61924",
      "background_image": "",
      "background_position": "50% 50%",
      "background_repeat": "no-repeat",
      "background_size": "cover"
    }
  }

);
</script>
<script language="javascript" type="text/javascript">  
function addCookie(name,value,days,path){   /**添加设置cookie**/  
    var name = escape(name);  
    var value = escape(value);  
    var expires = new Date();  
    expires.setTime(expires.getTime() + days * 3600000 * 24);  
    //path=/，表示cookie能在整个网站下使用，path=/temp，表示cookie只能在temp目录下使用  
    path = path == "" ? "" : ";path=" + path;  
    //GMT(Greenwich Mean Time)是格林尼治平时，现在的标准时间，协调世界时是UTC  
    //参数days只能是数字型  
    var _expires = (typeof days) == "string" ? "" : ";expires=" + expires.toUTCString();  
    document.cookie = name + "=" + value + _expires + path;  
}  
function getCookieValue(name){  /**获取cookie的值，根据cookie的键获取值**/  
    //用处理字符串的方式查找到key对应value  
    var name = escape(name);  
    //读cookie属性，这将返回文档的所有cookie  
    var allcookies = document.cookie;         
    //查找名为name的cookie的开始位置  
    name += "=";  
    var pos = allcookies.indexOf(name);      
    //如果找到了具有该名字的cookie，那么提取并使用它的值  
    if (pos != -1){                                             //如果pos值为-1则说明搜索"version="失败  
        var start = pos + name.length;                  //cookie值开始的位置  
        var end = allcookies.indexOf(";",start);        //从cookie值开始的位置起搜索第一个";"的位置,即cookie值结尾的位置  
        if (end == -1) end = allcookies.length;        //如果end值为-1说明cookie列表里只有一个cookie  
        var value = allcookies.substring(start,end); //提取cookie的值  
        return (value);                           //对它解码        
    }else{  //搜索失败，返回空字符串  
        return "";  
    }  
}  
function deleteCookie(name,path){   /**根据cookie的键，删除cookie，其实就是设置其失效**/  
    var name = escape(name);  
    var expires = new Date(0);  
    path = path == "" ? "" : ";path=" + path;  
    document.cookie = name + "="+ ";expires=" + expires.toUTCString() + path;  
}  
  
/**实现功能，保存用户的登录信息到cookie中。当登录页面被打开时，就查询cookie**/  
window.onload = function(){  

    var userNameValue = getCookieValue("userName");  
    document.getElementById("username").value = userNameValue;  

    var userPassValue = getCookieValue("userPass");  
    document.getElementById("password").value = userPassValue; 
    //alert(userNameValue) ;
   if(userPassValue!=""&&userPassValue!="")
   {
    $("#checkbox").attr("checked","checked");
    }
  //$("#chkRememberPass").attr("checked",false);
    

  

}  

//验证
$(function(){  //生成验证码         
    $('#kaptchaImage').click(function () {  
    $(this).hide().attr('src', 'kaptcha.jpg?' + Math.floor(Math.random()*100) ).fadeIn(); });      
});   

window.onbeforeunload = function(){  
    //关闭窗口时自动退出  
    if(event.clientX>360&&event.clientY<0||event.altKey){     
        alert(parent.document.location);  
    }  
};  
  		  
function changeCode() {  //刷新
    $('#kaptchaImage').hide().attr('src', 'kaptcha.jpg?' + Math.floor(Math.random()*100) ).fadeIn();  
    event.cancelBubble=true;  
}  
</script>  

</body>


</html>